package com.xunsiya.controller.order;

import com.xunsiya.module.order.vo.Product;
import com.xunsiya.service.module.order.ProductService;
import com.xunsiya.tools.common.msg.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 产品服务Controller
 *
 * @author panjun
 * @version 1.0
 *          <p>
 *          <p>修订人		修订时间			描述信息
 *          <p>-----------------------------------------------------
 *          <p>panjun		2018/10/31		初始创建
 */
@RestController
@RequestMapping("/api/product")
public class ProductController {

    @Autowired
    private ProductService productService;


    /**
     * 产品服务
     * @return
     */
    @GetMapping("/list")
    public Msg products() {
        List<Product> list = productService.findByParentId();
        return new Msg(true, "", list);
    }

    /**
     * 查询产品价格信息 (月份)
     * @return
     */
    @GetMapping("/findProductPrice")
    public Msg findProductPrice(){
        return productService.findProductPrice();
    }

}
